package day11;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;


public class homework04 {
    public static void main(String[] args) throws IOException {
        BufferedReader rw = new BufferedReader(new FileReader("worldcup.txt"));
        Map<String, String> map = new HashMap<>();
        String a;
        while ((a= rw.readLine()) != null) {
//            System.out.println(a);
            String[] strings = a.split("/");
//            System.out.println(Arrays.toString(strings));
            map.put(strings[0], strings[1]);
        }
        rw.close();
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年份");
        String str = scanner.nextLine();
        cupcountry(str,map);
    }
    public static void cupcountry(String str, Map<String, String> map) {
        if(map.containsKey(str)){
            System.out.println("世界杯在"+map.get(str)+"举行的");
        }else{
            System.out.println("没有世界杯");
        }
    }
}
